﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Master.master" AutoEventWireup="true" CodeFile="admin-khachhang.aspx.cs" Inherits="Admin_admin_khachhang" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div align="center"><p>QU&#7842;N L&Yacute; KH&Aacute;CH H&Agrave;NG</p>


    <asp:GridView ID="gv1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="makh" DataSourceID="SqlDataSource1" AllowPaging="True" 
        onrowcommand="GridView1_RowCommand" PageSize="4" Width="862px">
        <Columns>
            <asp:BoundField DataField="makh" HeaderText="makh" InsertVisible="False" 
                ReadOnly="True" SortExpression="makh" />
            <asp:BoundField DataField="tenkh" HeaderText="tenkh" SortExpression="tenkh" />
            <asp:BoundField DataField="dienthoai" HeaderText="dienthoai" 
                SortExpression="dienthoai" />
            <asp:BoundField DataField="diachi" HeaderText="diachi" 
                SortExpression="diachi" />
            <asp:CheckBoxField DataField="gioitinh" HeaderText="gioitinh" 
                SortExpression="gioitinh" />
            <asp:BoundField DataField="email" HeaderText="email" 
                SortExpression="email" />
            <asp:BoundField DataField="tendn" HeaderText="tendn" SortExpression="tendn" />
            <asp:BoundField DataField="matkhau" HeaderText="matkhau" 
                SortExpression="matkhau" />
            <asp:BoundField DataField="ngaysinh" HeaderText="ngaysinh" 
                SortExpression="ngaysinh" />
            <asp:CommandField ButtonType="Image" CancelImageUrl="~/images/cancel.gif" 
                CancelText="H&#7911;y" EditImageUrl="~/images/sua.png" EditText="S&#7919;a" 
                HeaderText="S&#7919;a" ShowEditButton="True" />
            <asp:ButtonField ButtonType="Image" CommandName="NutXoaKH" HeaderText="X&oacute;a" 
                ImageUrl="~/images/Delete.jpg" />
        </Columns>
        <PagerSettings NextPageImageUrl="~/images/sua.png" 
            PreviousPageImageUrl="~/images/sua.png" />
    </asp:GridView> </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConflictDetection="CompareAllValues" 
        ConnectionString="<%$ ConnectionStrings:F:\123456\CHECKOUT LAN 1\APP_DATA\QLSHOPTT.MDFConnectionString %>" 
        DeleteCommand="DELETE FROM [SanPham] WHERE [masp] = @original_masp AND (([tensp] = @original_tensp) OR ([tensp] IS NULL AND @original_tensp IS NULL)) AND (([mota] = @original_mota) OR ([mota] IS NULL AND @original_mota IS NULL)) AND (([dongia] = @original_dongia) OR ([dongia] IS NULL AND @original_dongia IS NULL)) AND (([trangthai] = @original_trangthai) OR ([trangthai] IS NULL AND @original_trangthai IS NULL)) AND (([hinh] = @original_hinh) OR ([hinh] IS NULL AND @original_hinh IS NULL)) AND (([madm] = @original_madm) OR ([madm] IS NULL AND @original_madm IS NULL)) AND (([soluong] = @original_soluong) OR ([soluong] IS NULL AND @original_soluong IS NULL)) AND (([donvitinh] = @original_donvitinh) OR ([donvitinh] IS NULL AND @original_donvitinh IS NULL)) AND (([ngaycapnhat] = @original_ngaycapnhat) OR ([ngaycapnhat] IS NULL AND @original_ngaycapnhat IS NULL))" 
        InsertCommand="INSERT INTO [SanPham] ([tensp], [mota], [dongia], [trangthai], [hinh], [madm], [soluong], [donvitinh], [ngaycapnhat]) VALUES (@tensp, @mota, @dongia, @trangthai, @hinh, @madm, @soluong, @donvitinh, @ngaycapnhat)" 
        OldValuesParameterFormatString="original_{0}" 
        SelectCommand="SELECT * FROM [KhachHang]" 
        
        UpdateCommand="UPDATE [SanPham] SET [tensp] = @tensp, [mota] = @mota, [dongia] = @dongia, [trangthai] = @trangthai, [hinh] = @hinh, [madm] = @madm, [soluong] = @soluong, [donvitinh] = @donvitinh, [ngaycapnhat] = @ngaycapnhat WHERE [masp] = @original_masp AND (([tensp] = @original_tensp) OR ([tensp] IS NULL AND @original_tensp IS NULL)) AND (([mota] = @original_mota) OR ([mota] IS NULL AND @original_mota IS NULL)) AND (([dongia] = @original_dongia) OR ([dongia] IS NULL AND @original_dongia IS NULL)) AND (([trangthai] = @original_trangthai) OR ([trangthai] IS NULL AND @original_trangthai IS NULL)) AND (([hinh] = @original_hinh) OR ([hinh] IS NULL AND @original_hinh IS NULL)) AND (([madm] = @original_madm) OR ([madm] IS NULL AND @original_madm IS NULL)) AND (([soluong] = @original_soluong) OR ([soluong] IS NULL AND @original_soluong IS NULL)) AND (([donvitinh] = @original_donvitinh) OR ([donvitinh] IS NULL AND @original_donvitinh IS NULL)) AND (([ngaycapnhat] = @original_ngaycapnhat) OR ([ngaycapnhat] IS NULL AND @original_ngaycapnhat IS NULL))">
        <DeleteParameters>
            <asp:Parameter Name="original_masp" Type="Int32" />
            <asp:Parameter Name="original_tensp" Type="String" />
            <asp:Parameter Name="original_mota" Type="String" />
            <asp:Parameter Name="original_dongia" Type="Int32" />
            <asp:Parameter Name="original_trangthai" Type="String" />
            <asp:Parameter Name="original_hinh" Type="String" />
            <asp:Parameter Name="original_madm" Type="Int32" />
            <asp:Parameter Name="original_soluong" Type="Int32" />
            <asp:Parameter Name="original_donvitinh" Type="String" />
            <asp:Parameter Name="original_ngaycapnhat" Type="DateTime" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="tensp" Type="String" />
            <asp:Parameter Name="mota" Type="String" />
            <asp:Parameter Name="dongia" Type="Int32" />
            <asp:Parameter Name="trangthai" Type="String" />
            <asp:Parameter Name="hinh" Type="String" />
            <asp:Parameter Name="madm" Type="Int32" />
            <asp:Parameter Name="soluong" Type="Int32" />
            <asp:Parameter Name="donvitinh" Type="String" />
            <asp:Parameter Name="ngaycapnhat" Type="DateTime" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="tensp" Type="String" />
            <asp:Parameter Name="mota" Type="String" />
            <asp:Parameter Name="dongia" Type="Int32" />
            <asp:Parameter Name="trangthai" Type="String" />
            <asp:Parameter Name="hinh" Type="String" />
            <asp:Parameter Name="madm" Type="Int32" />
            <asp:Parameter Name="soluong" Type="Int32" />
            <asp:Parameter Name="donvitinh" Type="String" />
            <asp:Parameter Name="ngaycapnhat" Type="DateTime" />
            <asp:Parameter Name="original_masp" Type="Int32" />
            <asp:Parameter Name="original_tensp" Type="String" />
            <asp:Parameter Name="original_mota" Type="String" />
            <asp:Parameter Name="original_dongia" Type="Int32" />
            <asp:Parameter Name="original_trangthai" Type="String" />
            <asp:Parameter Name="original_hinh" Type="String" />
            <asp:Parameter Name="original_madm" Type="Int32" />
            <asp:Parameter Name="original_soluong" Type="Int32" />
            <asp:Parameter Name="original_donvitinh" Type="String" />
            <asp:Parameter Name="original_ngaycapnhat" Type="DateTime" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:Label ID="lbThongBao" runat="server" Font-Bold="True" Font-Size="Medium" 
        ForeColor="#FF9933" Visible="False"></asp:Label>
</asp:Content>

